package com.zenika.zentracker.hibernate;

import org.hibernate.EmptyInterceptor;
import org.hibernate.Interceptor;
import org.hibernate.SessionFactory;

import com.zenika.zentracker.jmx.JMXSessionStats;

/**
 * Allows user code to inspect and/or change property values. <br/> <br/>
 * 
 * This type <u>IS NOT</u> used by Hibernate code, but by the ZenTracker tool. It adds behaviour to the Hibernate
 * Interceptor Interface. <br/>
 * 
 * This Interceptors used by ZenTracker are statefull. This means that they should be defined at the <tt>Session</tt>
 * level. They should not be used at the <tt>SessionFactory</tt> or <tt>Configuration</tt> level. Check Javadoc for
 * <tt>Interceptor</tt>.<br/>
 * 
 * It is usually better to extend <tt>ZenTrackerEmptyInterceptor</tt> and override only the callback methods of
 * interest.<br/>
 * 
 * @see SessionFactory#openSession(Interceptor)
 * @see org.hibernate.cfg.Configuration#setInterceptor(Interceptor)
 * @see EmptyInterceptor
 * @see ZenTrackerEmptyInterceptor
 * @author Zenika
 */
public interface ZenTrackerInterceptor extends Interceptor {

    void logSummary();
    
    JMXSessionStats buildJMXStats();
}
